package com.msa.msaportal.dao.impl;



import java.util.List;

import com.msa.msaportal.common.hibernate.Finder;
import com.msa.msaportal.common.hibernate.HibernateBaseDao;
import com.msa.msaportal.dao.IUserComponentDao;
import com.msa.msaportal.entity.UserComponent;
import com.msa.msaportal.entity.UserTile;

public class UserComponentDaoImpl extends HibernateBaseDao<UserTile, Integer> implements IUserComponentDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<UserComponent> getUserComponents(String userId) {
		Finder finder = Finder.create();
		String hql = "from UserComponent bean where bean.USER_ID=:userId";

		finder.append(hql);
		finder.setParam("userId", userId);
		return find(finder);
	}

	@Override
	public void insertUserComponent(UserComponent userComponent) {
		// TODO Auto-generated method stub
		this.getSession().save(userComponent);
	}

	@Override
	public void deleteUserComponent(UserComponent userComponent) {
		// TODO Auto-generated method stub
		this.getSession().delete(userComponent);
	}

	@Override
	protected Class<UserTile> getEntityClass() {
		// TODO Auto-generated method stub
		return null;
	}

	
	

}
